﻿<UserControl x:Class="PocoGen.Gui.Presentation.Views.ColumnView"
             x:ClassModifier="internal"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="clr-namespace:PocoGen.Gui.Presentation.Controls"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d" 
             d:DesignHeight="16" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
        </Grid.RowDefinitions>
        
        <Image Source="{StaticResource PrimaryKeyIcon}" Visibility="{Binding IsPrimaryKey,Converter={StaticResource IsPrimaryKeyConverter}}" Height="16" Margin="0,0,5,0" />

        <CheckBox Grid.Column="1" IsChecked="{Binding Included}" ToolTip="Include column" VerticalContentAlignment="Center" />

        <controls:ObjectDbTextEdit Grid.Column="2" DbElementName="{Binding ColumnName}" CodeElementName="{Binding PropertyName}" Margin="3,0,0,0" />
    </Grid>
</UserControl>